Importing XML: Creating and Altering Objects

In much the same as you would use ExportXML to read objects, ImportXML can be used to write to or create objects. ExportXML can only export a XML document with one object description in it. ImportXML can handle multiple objects; the XML source would look something like this:

<?xml version="1.0"?>
<XRKB>
  <OBJECT name="Cost_less_tax" type="VARIABLE" category="Variables">
    <INFO varType="NUMERIC" dim1="1" dim2="1" decs="0"/>
  </OBJECT>
  <OBJECT name="Procedure1" type="PROCEDURE" category="Objects">
    <VBSCRIPT value="TRUE"/>
    <CODE>
      @REM Call Object\n@DO Pikachu\n
    </CODE>
  </OBJECT>
</XRKB>

The <OBJECT> tag is simply redeclared for the next object. If the API sees that the object doesn't exist, then it will create the object, otherwise it will just overwrite it with the new information.

When importing an object with knowledge (cases, tree), if the API finds a tied object which doesn't exist and is not already in the XML document, it will try to create it for you using the values that it finds.